package dev.ece.core.cells.model;

import dev.ece.core.texture.FBOS;
import dev.ece.util.tools.Camera;

public abstract class AbstractModel<T> implements Model<T>, ModelEvent<T> {

	private boolean uninitialized = true;
	
	@Override
	public void initialize() {
		if(this.isUninitialized()) {
			this.onInitialize();
			this.setUninitialized(false);
		}
	}

	@Override
	public void renderDepthMap(Camera camera, T value) {
		this.onRenderDepthMap(camera, value);
	}
	
	@Override
	public void render(Camera camera, T value) {
		this.onRender(camera, value);
	}

	@Override
	public void renderAlpha(FBOS defer, Camera camera, T value) {
		this.onRenderAlpha(defer, camera, value);
	}

	protected boolean isUninitialized() {
		return uninitialized;
	}

	protected void setUninitialized(boolean uninitialized) {
		this.uninitialized = uninitialized;
	}

}
